package com.itheima.entity;

import java.awt.*;
import java.awt.image.BufferedImage;

public class FIyingObject {
    protected BufferedImage img;
    protected int x;
    protected int y;
    protected int width;
    protected int height;
    protected int speed;


    public BufferedImage getImg() {
        return img;
    }

    public void setImg(BufferedImage img) {
        this.img = img;
    }

    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }

    public int getWidth() {
        return width;
    }

    public void setWidth(int width) {
        this.width = width;
    }

    public int getHeight() {
        return height;
    }

    public void setHeight(int height) {
        this.height = height;
    }

    public void draw(Graphics g) {
        //绘制飞机
        g.drawImage(this.getImg(), this.getX(), this.getY(), this.getWidth(), this.getHeight(), null);
    }
}
